﻿using System.Web.Http.Filters;
using ZLWeb.WebApiInfrastructure.Filter;

namespace ZLWeb.WebApiApplication
{
    public class FilterConfig
    {
        public static void RegisterGlobalFilters(HttpFilterCollection filters)
        {
            //filters.Add(new HandleErrorAttribute());
            filters.Add(new ExceptionAttribute());

            /*AuthorizationFilterAttribute 执行顺序根据默认是添加顺序，所以以下代码顺序需要固定*/
            filters.Add(new UseSSLAtrribute());
            filters.Add(new SessionValidateAtrribute());



            //todo SSL加密与压缩共存
            //filters.Add(new DeflateCompressionAttribute());

            filters.Add(new RandomCodeAtrribute());
            filters.Add(new RunLogAtrribute());
            
        }
    }
}